let time;
export default function (interval = 1000) {
    return new Promise((resolve) => {
        if (time === undefined) {
            time = Date.parse(new Date());
            resolve && resolve();
        } else {
            const timeStamp = Date.parse(new Date());
            if (timeStamp - time < interval) {

            } else {
                time = timeStamp;
                resolve && resolve();
            }
        }
    });
}
